package com.linkq.ipinyin.enums;

import lombok.Getter;

/**
 * @author xuaolong
 */
@Getter
public enum WarningStatusEnums {
    To_Be_Released(0,"待发布"),
    Published(1,"已发布"),
    Finish(2,"已完成"),
    Back(3,"已撤销")
    ;

    WarningStatusEnums(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    private Integer type;

    private String desc;

    private Integer type() {
        return this.type;
    }

    private String desc() {
        return this.desc;
    }
    public static String getValue(Integer type) {
        WarningStatusEnums[] knowledgeEnums = values();
        for (WarningStatusEnums knowledge : knowledgeEnums) {
            if (knowledge.type().equals(type)) {
                return knowledge.desc();
            }
        }
        return null;
    }

    public static Integer getType(String desc) {
        WarningStatusEnums[] knowledgeEnums = values();
        for (WarningStatusEnums knowledge : knowledgeEnums) {
            if (knowledge.desc().equals(desc)) {
                return knowledge.type();
            }
        }
        return null;
    }
}
